# pull image
docker pull baldwinkm/mysql:5.7.33
# run mysql image in docker
docker run -itd --name mysql-5.7 -p 3306:3306 -e MYSQL_ROOT_PASSWORD="your mysql root pwd" mysql:5.7.33
# login mysql container
docker exec -it mysql-5.7 bash
# change the pwd for user root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'user-pwd!';
# create a remote user
CREATE USER 'remote_username'@'%' IDENTIFIED WITH mysql_native_password BY 'password'
# GRANT ALL PRIVILEGES
GRANT ALL PRIVILEGES ON *.* TO 'remote_username'@'%'
